from fractions import *;

# 2
# 0 0
# 1 0
# 0 1
# 1 1

# 2
# 0 0
# 1 1
# 1 0
# 2 1


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
d = list(map(int, input().split()))

def dot(a, b):
    res = 0
    for i in range(n):
        res += a[i] * b[i]
    return res

def determinant(a00, a01, a10, a11):
    return a00 * a11 - a01 * a10


for i in range(n):
    b[i] -= a[i]
    d[i] -= c[i]


t00 = dot(b, b)
t01 = -dot(b, d)
t10 = -t01
t11 = -dot(d, d)
y0 = dot(c, b) - dot(a, b)
y1 = dot(c, d) - dot(a, d)

D = determinant(t00, t01, t10, t11)


if D == 0:
    for i in range(n):
        a[i] -= c[i]
    A = dot(a, a) * dot(b, b) - dot(a, b) * dot(a, b)
    ans = Fraction(A, dot(b, b))
else:
    p = determinant(y0, t01, y1, t11)
    q = determinant(t00, y0, t10, y1)
    B = D * D
    A = 0
    # print(p, q)
    for i in range(n):
        x = a[i] * D + p * b[i]
        y = c[i] * D + q * d[i]
        A += (x-y) * (x-y)
        # print(x, y)
    ans = Fraction(A, B)

print("{}/{}".format(ans.numerator, ans.denominator))